package com.opencee.cloud.api.security;

import cn.hutool.crypto.SecureUtil;
import cn.hutool.crypto.symmetric.AES;

/**
 * @author liuyadu
 */
public class SecurityConstants {
    /**
     * jwt私有信息
     */
    public static final String PRIVATE_CLAIMS="privateClaims";

    public static final String AES_KEY = "lb+FH/EzIhyi0RQS";

    public static final String JWT_SIGN_KEY = "2cde1eaa60fe4af1987f94caa13f29a2";

    public static void main(String[] args) {
        // 随机生成密钥
        byte[] key = SecurityConstants.AES_KEY.getBytes();
        // 构建
        AES aes = SecureUtil.aes(key);
        // 加密
        // 加密为16进制表示
        String encryptHex = aes.encryptHex("中ddddddddddddddasdas擦拭打赏dsdasdsadsadasdsadsaddddddddddddddddddddddddddddddddddddddddd文");
        System.out.println(encryptHex);
        System.out.println(aes.decryptStr(encryptHex));
    }
}
